<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * 抵扣券控制器
 * @author [xiazhang] 
 * @date(2016-07-08)
 */
class Ticket extends CI_Controller {
	private $user_info;
	private $object = 'cny';
	private $ticketConfig;

	public function __construct(){  
        parent::__construct();
        $this->load->library('passPort');
        $this->passportClass = $this->passport;
        
        $this->passportClass->setPlatform($this->config->item('platform'));//设置平台
		$this->user_info = $this->passportClass->checkCookieAuthCode('','',true);
		$this->load->config('ticket');
		$this->ticketConfig	=	$this->config->item('ticketConfig');

    }

	public function index(){
		$share_date	=	"";
		if(!empty($this->user_info)){
			$this->load->library('TicketClass');
			$where		=	array('uid'=>$this->user_info['uid']);
			$share_info =	$this->ticketclass->getCnyShare($where);
			if(!empty($share_info) && $share_info['type']==1){
				$share_date	=	date("Y-m-d",strtotime($share_info['lastest_modify']));
			}
		}
		$assign['user_info']	= $this->user_info;
		$assign['share_date']	= $share_date;
		$assign['ticketConfig']	= $this->ticketConfig;
		$this->load->view('ticket/index',$assign);
	}

	public function activity(){
		$assign['user_info']	= $this->user_info;
		$this->load->view('ticket/activity',$assign);
	}
}
